#include "tractasklistserviceclient.h"
#include "../tasktop4qtcreator/marshalutil.h"
#include <QxtCore/QxtJSON>
#include "qdebug.h"
#include "../tasktop4qtcreator/tasklistserviceutil.h"
#include <coreplugin/icore.h>
#include <coreplugin/progressmanager/progressmanager.h>
#include <QxtCore/QxtLogger>
#include <QxtCore/QxtBasicFileLoggerEngine>


const char* const JOB_STATUS_COMPLETED = "COMPLETE";
const char* const JOB_STATUS_CANCELED = "CANCELLED";

TracTaskListServiceClient::TracTaskListServiceClient(QObject *parent) :
    TaskListServiceClient(parent),
    // @@@ what should be the parent of TracTicketExplorerBackend?
    // @@@ oops, TracTicketConfiguration only gives one ticket, not all of them.
    // @@@ I think.  tho buildQuery does the search..
    // @@@ the TracTicketExplorerBackend kicks off a query (for root?)
    manager(new TracTicketExplorerBackend(new TracTicketConfiguration(), 0)),
    requestingRoot(false)
{
    // @@@ need to connect TracTicketExplorerBackend signals to slots here?
}

TracTaskListServiceClient::~TracTaskListServiceClient()
{
    // @@@ do I need to delete manager here?

}

void TracTaskListServiceClient::root()
{
    if (!requestingRoot)
    {
        // @@@ get the root of all the tasks
        requestingRoot = true;
    }
}

void TracTaskListServiceClient::version()
{
}


void TracTaskListServiceClient::onRequestFinished(QNetworkReply *reply)
{
    Q_UNUSED(reply);


}

void TracTaskListServiceClient::image(QString identifier)
{

}

bool TracTaskListServiceClient::sendRequest(QString urlPostfix, bool post)
{
    Q_UNUSED(urlPostfix);
    Q_UNUSED(post);

    return false;
}

void TracTaskListServiceClient::container(QString identifier)
{
    Q_UNUSED(identifier);

}


void TracTaskListServiceClient::getEvents(qlonglong timestamp)
{
    Q_UNUSED(timestamp);

}

void TracTaskListServiceClient::task(QString identifier)
{
    Q_UNUSED(identifier);

}

void TracTaskListServiceClient::syncRoot()
{
}

void TracTaskListServiceClient::syncContainer(QString identifier)
{
    Q_UNUSED(identifier);

}

void TracTaskListServiceClient::syncTask(QString identifier)
{
    Q_UNUSED(identifier);

}

void TracTaskListServiceClient::markContainerRead(TaskContainer *container)
{
    Q_UNUSED(container);

}

void TracTaskListServiceClient::deleteContainer(TaskContainer *container)
{
    Q_UNUSED(container);

}

void TracTaskListServiceClient::markTaskRead(TaskHandle *task)
{
    Q_UNUSED(task);

}

void TracTaskListServiceClient::markTaskUnread(TaskHandle *task)
{
    Q_UNUSED(task);

}

void TracTaskListServiceClient::deleteTask(TaskHandle *task)
{
    Q_UNUSED(task);

}

void TracTaskListServiceClient::updateRepositoryConfiguration(QString containerHandle)
{
    Q_UNUSED(containerHandle);

}

void TracTaskListServiceClient::onJobChanged(QString identifier)
{
    Q_UNUSED(identifier);

}

void TracTaskListServiceClient::activeTask()
{
}

void TracTaskListServiceClient::deactivateTasks()
{
}

void TracTaskListServiceClient::activateTask(QString identifier)
{
    Q_UNUSED(identifier);

}

void TracTaskListServiceClient::timeoutWaitForJob()
{

}
